<head>
    <meta charset="utf-8" />
    <title>盒子模型</title>
    <style>
        #div1 {
            border: 3px red solid;
        }

        #div2 {
            border: 2px green solid;
            text-align: right;
            padding-left: 10px;
            padding-right: 10px;
            padding-top: 10px;
            padding-bottom: 10px;
            margin-top: 10px;
            margin-bottom: 10px;
            margin-left: 10px;
            margin-right: 10px;
        }

        #span1 {
            border: 1px blue solid;
        }

        #span2 {
            border: 1px blue solid;
        }
    </style>

<body>
    <div id="div1">
        <div id="div2">
            <span id="span1">span</span>
            <span id="span2">span</span>
        </div>
    </div>
</body>

</html>